/*
 * @Author: weikang
 * @Description:
 * @Date: 2023-12-22 10:36:12
 * @LastEditTime: 2024-05-08 10:58:48
 * @FilePath: \env-manager-pc\src\router\modules\electricity.statistics.ts
 */
import type { RouteRecordRaw } from 'vue-router'

enum TIME_TYPE {
  DAY = 'day',
  MONTH = 'month',
  REAL_TIME = 'real_time',
  YEAR = 'year',
}

function Layout() {
  return import('@/layouts/index.vue')
}

const routes: RouteRecordRaw = {
  path: '/electricity-statistics',
  component: Layout,
  redirect: '/electricity-statistics/byday',
  name: 'electricity-statistics',
  meta: {
    title: '电量统计',
    icon: 'ep:histogram',
  },
  children: [
    {
      path: 'period_time_day',
      name: 'period_time_day',
      component: () => import('@/views/electricity_statistics/period_time/index.vue'),
      meta: {
        title: '日时段电量',
        breadcrumb: false,
        timeType: TIME_TYPE.DAY,
      },
    },
    {
      path: 'period_time_month',
      name: 'period_time_month',
      component: () => import('@/views/electricity_statistics/period_time/index.vue'),
      meta: {
        title: '月时段电量',
        breadcrumb: false,
        timeType: TIME_TYPE.MONTH,
      },
    },
    {
      path: 'period_time_year',
      name: 'period_time_year',
      component: () => import('@/views/electricity_statistics/period_time/index.vue'),
      meta: {
        title: '年时段电量',
        breadcrumb: false,
        timeType: TIME_TYPE.YEAR,
      },
    },
    {
      path: 'byday',
      name: 'electricity-statistics-byday',
      meta: {
        title: '日电量',
        auth: '/electricity-statistics/byday',
      },
      children: [
        {
          path: '',
          name: 'electricity-statistics-byday-list',
          component: () => import('@/views/electricity_statistics/by.day/index.vue'),
          meta: {
            title: '日电量',
            sidebar: false,
            breadcrumb: false,
            activeMenu: '/electricity-statistics/byday',
            auth: ['/electricity-statistics/byday', '/electricity-statistics/byday/detail/:id'],
          },
        },
        {
          path: 'detail/:id',
          name: 'electricity-statistics-byday-detail',
          component: () => import('@/views/electricity_statistics/by.day/by.day.detail.vue'),
          meta: {
            title: '设备日电量',
            sidebar: false,
            breadcrumb: false,
            activeMenu: '/electricity-statistics/byday',
            auth: '/electricity-statistics/byday/detail/:id',
          },
        },
      ],
    },
    {
      path: 'bymonth',
      name: 'electricity-statistics-bymonth',
      meta: {
        title: '月电量',
        auth: '/electricity-statistics/bymonth',
      },
      children: [
        {
          path: '',
          name: 'electricity-statistics-bymonth-list',
          component: () => import('@/views/electricity_statistics/by.day/index.vue'),
          meta: {
            title: '月电量',
            sidebar: false,
            breadcrumb: false,
            activeMenu: '/electricity-statistics/bymonth',
            auth: ['/electricity-statistics/bymonth', '/electricity-statistics/bymonth/detail/:id'],
          },
        },
        {
          path: 'detail/:id',
          name: 'electricity-statistics-bymonth-detail',
          component: () => import('@/views/electricity_statistics/by.day/by.day.detail.vue'),
          meta: {
            title: '设备月电量',
            sidebar: false,
            breadcrumb: false,
            activeMenu: '/electricity-statistics/bymonth',
            auth: '/electricity-statistics/bymonth/detail/:id',
          },
        },
      ],
    },
  ],
}

export default routes
